package org.simple.base.model

import org.nutz.dao.pager.Pager
import org.simple.base.json.model.JsonResponse
import org.simple.base.util.PropertyCnd

class QueryRequest {

    Pager pager

    QuickMap filters

    QuickMap param

    public List<PropertyCnd> makeCnd() {
        return PropertyCnd.fromMap(filters)
    }

    String toString() {
        toJson()
    }
}

class QueryResponse {

    Pager pager

    List rows

    String toString() {
        toJson()
    }

    JsonResponse<QueryResponse> toJsonResponse() {
        return new JsonResponse<QueryResponse>(
                body: this
        )
    }
}